]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
calendar: Use connectObject on _sectionList
authorDaniel van Vugt <daniel.van.vugt@canonical.com>
Wed, 17 Aug 2022 08:26:28 +0000 (16:26 +0800)
committerMarge Bot <marge-bot@gnome.org>
Thu, 18 Aug 2022 07:55:20 +0000 (07:55 +0000)
This prevents _sync() being called after actor destruction (since actor
destruction became more reliable in mutter@3d94c7cc2) and so eliminates
this shutdown error:

```
(gnome-shell:35197): Gjs-CRITICAL **: 16:31:02.769: Object .Gjs_ui_calendar_Placeholder (0x559ed6e547e0), has been already disposed — impossible to set any property on it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
== Stack trace for context 0x559ed6022310 ==
 #0   559ed783c5a8 i   resource:///org/gnome/shell/ui/calendar.js:1012 (31955be5fc90 @ 148)
 #1   7ffef8f38230 b   self-hosted:1178 (32af8f6b0c40 @ 454)
 #2   559ed783c518 i   resource:///org/gnome/shell/ui/popupMenu.js:806 (31955be18ce0 @ 52)
 #3   559ed783c488 i   resource:///org/gnome/shell/ui/popupMenu.js:954 (31955be190b0 @ 168)
 #4   559ed783c3f8 i   resource:///org/gnome/shell/ui/panelMenu.js:189 (31955be88150 @ 41)
 #5   7ffef8f3de60 b   self-hosted:1178 (32af8f6b0c40 @ 423)
```

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2429>

js/ui/calendar.js

index 9981a456f6bbff7effd6b592c15b679af3b3b9f5..90ef9cc959f9460bef58925959bd4c6c755534ae 100644 (file)
@@ -976,8 +976,10 @@ class CalendarMessageList extends St.Widget {
             y_expand: true,
             y_align: Clutter.ActorAlign.START,
         });
-        this._sectionList.connect('actor-added', this._sync.bind(this));
-        this._sectionList.connect('actor-removed', this._sync.bind(this));
+        this._sectionList.connectObject(
+            'actor-added', this._sync.bind(this),
+            'actor-removed', this._sync.bind(this),
+            this);
         this._scrollView.add_actor(this._sectionList);
 
         this._mediaSection = new Mpris.MediaSection();